package com.usercar.service.impl;

import com.usercar.pojo.AdvertisingPrice;
import com.usercar.mapper.AdvertisingPriceMapper;
import com.usercar.pojo.Content;
import com.usercar.service.IAdvertisingPriceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-08-12
 */
@Service
public class AdvertisingPriceServiceImpl extends ServiceImpl<AdvertisingPriceMapper, AdvertisingPrice> implements IAdvertisingPriceService {

    @Autowired
    private AdvertisingPriceMapper advertisingPriceMapper;
    @Override
    public AdvertisingPrice selectByFieldAndIsFe(Long field, Integer i) {
        Map<String,Object> map = new HashMap<>();
        map.put("field",field);
        map.put("is_festival",i);
        List<AdvertisingPrice> advertisingPrices = advertisingPriceMapper.selectByMap(map);
        return advertisingPrices.get(0);
    }
}
